package com.yiligi.myserver.service.Impl;

import com.yiligi.myserver.mapper.StudentMapper;
import com.yiligi.myserver.pojo.Student;
import com.yiligi.myserver.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public Student selectStudentByStudentId(String studentId) {
        return studentMapper.selectStudentByStudentId(studentId);
    }

    @Override
    public int addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public List<Student> selectStudentPage(int pageNum, int pageSize, String studentId, String name, String studentClass) {
        pageNum = (pageNum-1) * pageSize;
        return studentMapper.selectStudentPage(pageNum,pageSize,studentId,name,studentClass);
    }

    @Override
    public int selectTotal(String studentId, String name, String studentClass) {
        return studentMapper.selectTotal(studentId,name,studentClass);
    }
}
